package wisents.wicket.form.submitingstrategy;

import wisents.api.FormRepresentation;

public class WicketAjaxButtonFormSubmittingStrategy implements WicketFormSubmittingStrategy {

    private final String linkRelativePath;

    public WicketAjaxButtonFormSubmittingStrategy(String linkRelativePath) {
        this.linkRelativePath = linkRelativePath;
    }

    @Override
    public void submit(FormRepresentation form) {
        new EnhancedWicketFormTesterFactory()
                .createEnhancedFormTester(form)
                .submitWithAjaxButton(linkRelativePath);
    }
}
